package com.mate.cloud.lottery.exception;

import com.mate.cloud.common.constant.ResponseEnum;
import com.mate.cloud.common.exception.BusinessRuntimeException;

/**
 * 业务异常
 *
 * @author: MI
 * @email: 448341911@qq.com
 * @createTime: 2025/1/24 12:05
 * @updateUser: MI
 * @updateTime: 2025/1/24 12:05
 * @updateRemark: 修改内容
 * @version: v1.0
 */
public abstract class BusinessException extends BusinessRuntimeException {


    public BusinessException() {
    }

    public BusinessException(Integer code) {
        super(code);
    }

    public BusinessException(String message) {
        super(message);
    }
    /**
     * 使用错误码枚举创建异常
     */
    public BusinessException(final ResponseEnum errorMessage) {
        this(errorMessage.getCode(), errorMessage.getLocalMessage());
    }

    public BusinessException(Integer code, String message) {
        super(code, message);
    }

    public BusinessException(Integer code, String message, String parameters) {
        super(code, message, parameters);
    }

    public BusinessException(Integer code, String... parameters) {
        super(code, parameters);
    }

    public BusinessException(Integer code, String message, String... parameters) {
        super(code, message, parameters);
    }



    public BusinessException(Integer code, String errorMessage, Throwable cause, String... parameters) {
        super(code, errorMessage, cause, parameters);
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }
}
